package com.manshutingyu.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import com.manshutingyu.system.domain.SysUserRole;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Set;

/**
 * @Author：yinyuxia
 * @Date：2025/3/29 17:01
 */
public interface SysUserRoleMapper extends BaseMapper<SysUserRole> {
    @Select("SELECT DISTINCT r.role_key  FROM sys_user_role ur   LEFT JOIN sys_role r ON r.id = ur.role_id   WHERE r.del_flag = 0 AND ur.user_id = #{userId}")
    Set<String> getRoleListByUserId(@Param("userId") Long userId);
}
